package com.example.springbootthreadexamples.service;

import com.example.springbootthreadexamples.thread.UserContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.ClassUtils;

/**
 * @author LanWP
 * @date 2024-08-02
 */
@Service
public class TestService {

    @Async
    public void asyncMethod() {
        System.out.println(ClassUtils.getShortName(getClass()) + "异步方法执行中..." + Thread.currentThread().getName());
        System.out.println(UserContext.getUserContext());
    }

}
